package de.wojenko.sps;

public class FileGenerator {

	public static void main(String[] args) {
		XmlFileTaskServiceProvider provider = new XmlFileTaskServiceProvider();

		for (int i = 1; i <= 60; i++) {
			final int k = i;
			TaskService service = provider.getService(new BacklogItem() {
				
				@Override
				public int getSprintNumber() {
					return k;
				}
				
				@Override
				public String getName() {
					return null;
				}
				
				@Override
				public String getId() {
					return "12345";
				}
				
				@Override
				public String getContent() {
					return null;
				}
			});
			service.storeTasks(createTasks(i));
		}
	}

	private static BacklogItemArtefactHolder<Task> createTasks(int i) {
		BacklogItemArtefactHolder<Task> tasks = new BacklogItemArtefactHolder<Task>(
				"" + i);
		for (int j = 0; j <= i; j++) {

			Task element = new Task() {

				private String text;
				private String content;

				@Override
				public String getId() {
					return "ABCD-001 / 01";
				}

				@Override
				public void setText(String text) {
					this.text = text;
				}

				@Override
				public void setComment(String comment) {
					this.content = comment;
				}

				@Override
				public String getText() {
					return text;
				}

				@Override
				public String getComment() {
					return content;
				}
			};
			element.setText("Alfa Beta\nGamma Delta " + j);
			element.setComment("This is the\ncomment " + i);
			tasks.add(element);
		}
		return tasks;
	}
}
